package com.ytktt.study.week12.task11.handler;

import com.ytktt.study.week12.task11.MyGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 出站处理器业务实现
 *
 * @author ytk
 */
@Slf4j
@RequiredArgsConstructor
@Component
public class MqttMessageOutboundHandler implements MessageOutboundHandler {

    private final MyGateway myGateway;

    @Override
    public void send(String topic, String message) {
        this.myGateway.sendToMqtt(topic, message);
    }

    @Override
    public void send(String topic, byte[] message) {
        this.myGateway.sendToMqtt(topic, message);
    }
}
